package example.chapter12.combobox;

import java.util.HashMap;
import java.util.Map;

import com.opensymphony.xwork2.ActionSupport;

public class ComboboxTagAction extends ActionSupport{
	private Map<String,String> mapTraffics;
	private String checkedFruit;
	private String checkedFlower;
	private String checkedTraffic;
	
	public String execute() throws Exception{
		//Example1
		System.out.println("checkedFruit: " + checkedFruit);
		
		//Example2
		System.out.println("checkedFlower: " + checkedFlower);
		
		//Example3
		System.out.println("checkedTraffic: " + checkedTraffic);
		
		mapTraffics = new HashMap<String,String>();
		mapTraffics.put("a", "airplane");
		mapTraffics.put("b", "bus");
		mapTraffics.put("t", "taxi");
		
		return SUCCESS;
	}

	public Map<String, String> getMapTraffics() {
		return mapTraffics;
	}

	public void setMapTraffics(Map<String, String> mapTraffics) {
		this.mapTraffics = mapTraffics;
	}

	public String getCheckedFruit() {
		return checkedFruit;
	}

	public void setCheckedFruit(String checkedFruit) {
		this.checkedFruit = checkedFruit;
	}

	public String getCheckedFlower() {
		return checkedFlower;
	}

	public void setCheckedFlower(String checkedFlower) {
		this.checkedFlower = checkedFlower;
	}

	public String getCheckedTraffic() {
		return checkedTraffic;
	}

	public void setCheckedTraffic(String checkedTraffic) {
		this.checkedTraffic = checkedTraffic;
	}
	
}
